import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
  state: {
    article: null,
    user: null,
    articleCache: null
  },
  mutations: {
    set(state, newValue) {
      state.article = newValue.value
    },
    get() {
      return state.article
    },
    setUser(state, newValue) {
      state.user = newValue.value
    },
    setArticleCache(state, newValue) {
      state.articleCache = newValue.value
    }
  }
})

export default store
